{template "header.html"}


<div class="page-content">

    <div class="container">

        <ul class="page-breadcrumb breadcrumb">
            <li class="symbol-title">
                <a href="{SITE_URL}">网站首页</a>
                <i class="fa fa-circle"></i>
            </li>
            {dr_catpos($catid, '', true, '<li> <a href="[url]">[name]</a> <i class="fa fa-circle"></i> </li>')}
            <li>
                <a href="{$index.url}">{$index.title}</a>
                <i class="fa fa-circle"></i>
            </li>
            <li>
                <span>{$title}</span>
            </li>
        </ul>

    </div>

    <div class="container margin-top-30">

        <div class="row">
            <div class="col-md-8">

                {if $vip && $index.price > 0}


                {if $uid == $member.id || dr_is_video_buy(MOD_DIR, $index.id)}

                <!--vip播放-->
                {dr_video_player($id, '100%', '400px', 1)}
                {else}

                {if $ckplayer_config['viptime']}
                <!--vip试看播放-->
                {dr_video_player($id, '100%', '400px', 0, 1)}
                {/if}

                <div class="subscribe" style="text-align: center">
                    <div class="title"><i class="ico left_ico"></i>本视频是VIP视频，需要购买才能继续播放<i class="ico right_ico"></i></div>
                    <p>
                        <a href="{dr_url('video/buy/index', ['fid' => $ci->module['field']['price']['id'], 'id'=>$index.id])}" target="_blank" class="btn btn-circle2 red"> 购买VIP（¥{$index.price}） </a>
                    </p>
                </div>
                {/if}
                {else}
                <!--免费播放-->
                {dr_video_player($id, '100%', '400px', dr_is_video_buy(MOD_DIR, $index.id))}
                {/if}
            </div>
            <div class="col-md-4">

                <div class="portlet light " style="margin-top: -25px">
                    <div class="portlet-title">
                        <div class="caption">
                            <span class="caption-subject font-dark">{$index.title}</span>
                        </div>

                    </div>
                    <div class="portlet-body">
                        <div class="jdms">{$jdms}</div>
                        <div class="jrkd">
                            <a href="javascript:jrkd();" class="btn red btn-outline  btn-block sbold uppercase btn-circle2 "> 加入看单追剧 </a>
                        </div>
                        <ul class="juji-list clearfix">
                        {loop $son_type $tid $name}
                            {loop $son_list[$tid] $t}
                            <li class="item {if $t.id==$id}selected{/if}">
                                <a href="{$t.url}">{$t.title}</a>
                                {if $t.vip}<span class="site-piclist_icons">
                            <img class="icon-viedo-nmr" src="/static/default/web/img/vip.png">
                          </span>{/if}
                            </li>
                            {/loop}
                        </ul>
                        {/loop}
                    </div>
                </div>

            </div>
        </div>

        <div class="portlet light" style="padding: 20px 0 0 0 ;">
            <div class="portlet-title">
                <div class="caption">
                    <span class="caption-subject font-dark blod">视频简介</span>
                </div>

            </div>
            <div class="portlet-body">


{$neirong}


            </div>
        </div>


        <div class="scroll-to-top">
            <ul class="side-left ">

                <li class="my_cart icon-box icon-box-bookshelf" data-target="addshelf"></li>
                <li class="icon-box icon-box-catalog" data-target="chaplist"></li>
            </ul>

            <ul class="side-right">
                <li class="icon-box icon-box-prev" data-target="prev-chapter" data-href="{$prev_page.url}"></li>
                <li class="icon-box icon-box-next" data-target="next-chapter" data-href="{$next_page.url}"></li>
            </ul>



        </div>
    </div>



</div>

<script>
$(function () {
    $('.icon-box-prev').click(function () {
        var url = $(this).attr('data-href');
        if (url) {
            window.location.href = url;
        } else {
            dr_tips(0, '没有上一页');
        }

    });
    $('.icon-box-next').click(function () {
        var url = $(this).attr('data-href');
        if (url) {
            window.location.href = url;
        } else {
            dr_tips(0, '没有下一页');
        }

    });
    $('.icon-box-catalog').click(function () {
        layer.open({
            type: 1,
            shade: false,
            scrollbar: false,
            area: ['50%', '300px'],
            title: false,
            content: $('.layer_notice')
        });
    });
    $('.my_cart').click(function () {
        var myobj = $(this);
        $.get("/index.php?is_ajax=1&s={MOD_DIR}&c=show&m=cart&id={$index.id}", function(json){
            dr_tips(json.code, json.msg);
            if (json.code) {
                if (json.data) {
                    myobj.removeClass('icon-box-bookshelf');
                    myobj.addClass('icon-box-bookshelf2');
                } else {
                    myobj.removeClass('icon-box-bookshelf2');
                    myobj.addClass('icon-box-bookshelf');
                }
            }
        }, 'json');
    });
    {if $member && dr_is_video_cart(MOD_DIR, $index.id, $member.id)}
    $('.my_cart').removeClass('icon-box-bookshelf');
    $('.my_cart').addClass('icon-box-bookshelf2');
    $.get("/index.php?is_ajax=1&s={MOD_DIR}&c=show&m=add_cart&id={$index.id}&sid={$id}", function(json){

    }, 'json');
    {/if}
});
function jrkd() {
    $.get("/index.php?is_ajax=1&s={MOD_DIR}&c=show&m=cart&id={$index.id}", function(json){
        dr_tips(json.code, json.msg);
    }, 'json');
}
//点击了跳过广告按钮
function adjump() {
    alert('购买VIP播放免广告');
}
// 记住播放时间
var times = new Array();
function dr_player_auto_time(time) {
    time = parseInt(time);
    if (times.hasOwnProperty(time)) {
        return; // 防止重复
    }
    times[time] = time;
    if (time > 0 && time%5==0) {

        $.get("/index.php?is_ajax=1&s={MOD_DIR}&c=show&m=add_cart&id={$index.id}&sid={$id}&time="+time, function(json){

        }, 'json');
    }
}
</script>

{template "footer.html"}
<div class="layer_notice" style="display: none">

    <div class="portlet light" style="margin-bottom: 0">
        <div class="portlet-body">


            <div class="panel-group accordion scrollable" id="accordion">

                {loop $son_type $tid $name}
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a class="accordion-toggle {if $tid>0}collapsed{/if}" data-toggle="collapse" data-parent="#accordion" href="#collapse_{$tid}"> {$name} </a>
                        </h4>
                    </div>
                    <div id="collapse_{$tid}" class="panel-collapse  {if $tid>0}collapse{else}in{/if}">

                        <ul class="booklist clearfix">
                            {loop $son_list[$tid] $t}
                            <li>
                                <a href="{$t.url}" {if $t.id==$id}style="color:red"{/if} target="_blank"class="qh">{$t.title}</a>
                                {if $t.vip}<span class="vip">VIP</span>{else}<span class="free">免费</span>{/if}
                            </li>
                            {/loop}
                        </ul>
                    </div>
                </div>
                {/loop}

            </div>


        </div>
    </div>
</div>